package org.example;

import org.example.rpc.core.RpcClient;
import org.example.rpc.core.RpcClientProxy;
import org.example.rpc.core.netty.client.NettyClient;
import org.example.rpc.core.serializer.KryoSerializer;

public class NettyTestClient {

    public static void main(String[] args) {
        RpcClient client = new NettyClient("127.0.0.1", 8888);
        client.setSerializer(new KryoSerializer());
        RpcClientProxy rpcClientProxy = new RpcClientProxy(client);
        HelloService helloService = rpcClientProxy.getProxy(HelloService.class);
        HelloObject object  = new HelloObject(1, "123");
        String hello = helloService.hello(object);
        System.out.println("结果：" + hello);
    }
}
